#include <stdio.h>
#include <string.h>
#include "wrap.h"
int main(int argc, char const *argv[])
{
        int fd = Socket(AF_INET,SOCK_DGRAM,0);
        
        //显示的绑定ip和端口
        struct sockaddr_in client;
        memset(&client,0,sizeof(client));
        client.sin_family = AF_INET;
        client.sin_port = htons(6767);
        inet_pton(AF_INET,"0.0.0.0",&client.sin_addr.s_addr);
        Bind(fd,(struct sockaddr*)&client, sizeof(client));

        //接收数据
        char buf[1024] = {0};
        while (1){
                int len = recvfrom(fd,buf,sizeof(buf),0,NULL,NULL);
                if(len == -1){
                        perror("recv error");
                        break;
                }
                printf("client recv buf:%s\n",buf);
        }
        Close(fd);
        return 0;
}
